package com.gzist.elderlyserviceplatform.controller.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gzist.elderlyserviceplatform.common.Result;
import com.gzist.elderlyserviceplatform.common.base.BaseDTO;
import com.gzist.elderlyserviceplatform.entity.po.Video;
import com.gzist.elderlyserviceplatform.service.VideoService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 视频管理
 */
@RestController
@Tag(name = "视频管理")
@RequestMapping("/api/client/video")
@RequiredArgsConstructor
public class VideoControllerC {

    private final VideoService videoService;

    @PostMapping("/list")
    @Operation(summary = "视频列表")
    public Result<Page<Video>> list(
            @RequestBody
            @Parameter(description = "分页条件") BaseDTO baseDTO
    ) {
        return Result.success(videoService.ClientlistVideo(baseDTO), "查询成功");
    }

    @GetMapping("/detail/{id}")
    @Operation(summary = "视频详情")
    public Result<Video> query(
            @PathVariable
            @Parameter(description = "视频主键id") String id
    ) {
        return Result.success(videoService.getById(id), "查询成功");
    }
}